package com.hd.trans.ui.base;

import android.annotation.SuppressLint;
import android.app.Application;
import android.content.Context;

public class AppContextProvider {
    private AppContextProvider() {}

    @SuppressLint("StaticFieldLeak")
    private static Context mContext;

    public static void init(Context context){
        if(mContext == null){
            mContext = context;
        }
    }

    public static Context getContext() {
        if(mContext == null){
            throw new IllegalStateException("context has not been initialized");
        }
        return mContext;
    }
}
